﻿using GameCreator.Core;
using GameCreator.Core.Hooks;
using Gp.Scripts.GameLogic;
using Gp.Scripts.Core;
using UnityEngine;

namespace Gp.GCX
{
    [AddComponentMenu("")]
    public class TransformChangeAc : IAction
    {
        public GameObject[] oriObjs;
        public GameObject desObj;
        public override bool InstantExecute(GameObject target, IAction[] actions, int index) {
            foreach (GameObject obj in oriObjs) {
                obj.transform.position = desObj.transform.position;
            }
            return true;
        }

#if UNITY_EDITOR
        public new static string NAME = "Gp/其他/坐标赋值";
        private const string NODE_TITLE = "赋值为 {0} 的坐标";

        public override string GetNodeTitle() {
            string str = desObj == null ? "无" : desObj.name;
            return string.Format(NODE_TITLE, str);
        }

#endif
    }
    
    
}